<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
[#include "/admin/include/head.htm"]
<script type="text/javascript">
    var grid;
    $(function(){
         grid = $("#maingrid").ligerGrid({
            columns: [
                {display: 'ID', name: 'id', width:50, align: 'center', isAllowHide: false},
                {display: '商品', name: 'product.name', align: 'center', width: 150},
                {display: '订单号', name: 'orderNo', align: 'center', width: 150},
                {display: '配送门店', name: 'store.name', align: 'center', width: 150},

                {display: '手机', name: 'phone', align: 'center', width: 150},
                {display: '地址', name: 'address', align: 'center', width: 150},
                {display: '快递单号', name: 'express', align: 'center', width: 150},
                {display: '快递名', name: 'deliveryMethod.name', align: 'center', width: 150},
                {display: '状态', name: 'status', align: 'center', width: 150,i18n:'IntergralOrderStatus'},
                {
                    display: '用户', name: 'member.username', align: 'center', width: 150
                }
            ],  pageSize:20, url: 'queryData.jhtml',toolbar: {}, width: '100%', height:'100%', enabledSort: true
        });

        $("#pageloading").hide();
        LG.loadToolbar(grid);

        //绑定搜索按钮
        LG.search(grid);


    });

    function send() {

        var selecteds = grid.getSelecteds();
        if (selecteds.length != 1) {
            LG.tip('请选择一行记录!');
            return;
        }
        top.f_addTab(null, '修改商品', 'b2c/b2c_intergral_order/send.jhtml?id=' + selecteds[0].id);

    }


    /**
     * 商品上架
     */
    //  function send() {
    //        var selecteds = grid.getSelecteds();
    //        if (selecteds.length > 0) {
    //            jQuery.ligerDialog.confirm('确定调整状态为配送中吗?', function (confirm) {
    //                if (confirm){
    //                    LG.ajax({
    //                        url: base + '/admin/b2c/b2c_intergral_order/send.jhtml',
    //                        loading: '状态调整中...',
    //                        data: { id: LG.getIds(selecteds) },
    //                        success: function (message) {
    //                            LG.showSuccess("操作成功");
    //                            f_reload();
    //                        },
    //                        error: function (message) {
    //                            LG.showError(message);
    //                        }
    //                    });
    //                }
    //            });
    //        } else {
    //            LG.tip('请选择行!');
    //        }
    //  }

    /**
     * 商品下架
     */
    function received() {
        var selecteds = grid.getSelecteds();
        if (selecteds.length > 0) {
            jQuery.ligerDialog.confirm('确定调整状态为已收货吗?', function (confirm) {
                if (confirm){
                    LG.ajax({
                        url: base + '/admin/b2c/b2c_intergral_order/received.jhtml',
                        loading: '正在调整中',
                        data: { id: LG.getIds(selecteds) },
                        success: function (message) {
                            LG.showSuccess("操作成功");
                            f_reload();
                        },
                        error: function (message) {
                            LG.showError(message);
                        }
                    });
                }
            });
        } else {
            LG.tip('请选择行!');
        }
    }

    //编辑商品
    function edit(){
        var selecteds = grid.getSelecteds();
        if (selecteds.length != 1) {
            LG.tip('请选择一行记录!');
            return;
        }
        top.f_addTab(null, '修改商品', 'b2c/intergral_shop_product/edit/'+selecteds[0].id+".jhtml");
    };
</script>
</head>
<body style="padding:10px; overflow:hidden;">
    <div id="functions">
        <div class="clearfix">
            <div style="float:left;">
                <span>
                    名称：<input type="text" class="formText" name="search_LIKE_product.name"/>
                </sapn>

                <input type="button" class="button" value="搜索" id="search"/>
                <a href="#" id="search_btn_reset" face="Wingdings 3">清除本次搜索</a>
            </div>
        </div>
    </div>
    <div id="maingrid" style="margin:0; padding:0"></div>
</body>
</html>